/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package databaseinterface;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.List;
import objects.FileInfo;
import objects.UserInfo;

/**
 *
 * @author tinvukhac
 */
public interface DatabaseInterface extends Remote{
    public String insertNewUser(String userId, String password, String ipAddress,int port) throws RemoteException;
    public String checkLoginUser(String userId, String password, String ipAddress,int port) throws RemoteException;
    public int insertNewFileInfo(String userId, String fileName, float fileSize,
                                      String fileDescription) throws RemoteException;
    public List<FileInfo> getSharedFileList() throws RemoteException;

    public List<UserInfo> getFileSeeders(int fileId) throws RemoteException;
    public FileInfo getFileInfo(int Id) throws RemoteException;
    public void confirm(String userId) throws RemoteException;
    public int getNumberSharing(int fileId) throws RemoteException;
    public int getNumberDownloading(int fileId) throws RemoteException;
    public List<UserInfo> getSharingUser(int fileId) throws RemoteException;
    public List<UserInfo> getDownloadingUser(int fileId) throws RemoteException;
    public void confirmDownloading(int fileId,String userId) throws RemoteException;
    public void confirmDownloadComplete(int fileId,String userid) throws RemoteException;
    public List<FileInfo> searchFile(String pattern, boolean isFullTextSearch) throws RemoteException;
}
